package e

var errMsg = map[int]string{

	//
	Ok:                   "请求成功",
	Error:                "请求失败",
	InvalidParams:        "参数错误",
	InvalidContentIsNull: "参数数据错误，内容值为空",
	UndefinedCode:        "未知错误",
	NoRecord:             "未查询到数据",
	DeSerializeObjErr:    "反序列化对象失败",
	SerializeObjErr:      "序列化对象失败",

	EngineRequestFail:     "请求其他平台服务失败",
	ErrorAuthUserNotLogin: "访问资源权限验证失败",
	PaidServiceHint:       "该接口为付费服务，暂已关闭，如有疑问请联系服务提供方。",

	ErrorDbSessionBeginFail:  "数据库事务开始失败",
	ErrorDbSessionCommitFail: "数据库事务提交失败",
	ErrorDbInsertFail:        "数据库插入数据失败",
	ErrorDbRowsNoEffect:      "数据库插入未更改原有数据",
	ErrorDbGetFail:           "数据库获取数据失败",
	ErrorDbUpdateFail:        "数据库更新数据失败",
	ErrorDbDeleteFail:        "数据库删除数据失败",

	ErrorGetAccountFailed:   "获取账户地址失败",
	ErrorGetAdminFailed:     "获取管理员失败",
	ErrorGetWhiteFailed:     "获取白名单失败",
	ErrorGetPeerCountFailed: "获取节点数量失败",
	ErrorGetNodeInfoFailed:  "获取节点信息失败",
	ErrorConnectChainFailed: "链节点连接失败",

	ErrorSendTransactionFailed:       "交易发送失败",
	ErrorGetTransactionReceiptFailed: "获取交易确认信息失败",
	ErrorGetNonceFailed:              "nonce 获取失败",
	ErrorGetBlockFailed:              "获取区块失败",
	ErrorGetTransactionNotFound:      "未查询交易信息",
	ErrorGetBlockNotFound:            "未查询区块信息",
	ErrorCalMinerAddress:             "计算出块节点地址出错",
	ErrorGraphqlGetBlockFailed:       "graphql获取区块出错",
	ErrorGraphqlGetTxFailed:          "graphql获取交易出错",

	//合约调用相关
	DataFormatErr:          "日期格式错误，请检查",
	EndTimeErr:             "日期错误，结束时间早于开始时间",
	CallContractErr:        "调用合约失败：",
	ContractAddrErr:        "合约地址解析错误：",
	ChainIDReadErr:         "连接的链节点链ID解析错误：",
	CreateSignerErr:        "create a transaction signer from a single private key error",
	ResultEmpty:            "未查询到该业务的数据信息：",
	DeployContractErr:      "部署合约失败：",
	ContractAccountConfErr: "合约账户配置错误",
	NotInTrialListErr:      "贵行非本次贷后资金监管业务试点行，无法调用接口",
}

// GetMsg get error information based on Code
func GetMsg(code int) string {
	msg, ok := errMsg[code]
	if ok {
		return msg
	}
	return errMsg[UndefinedCode]
}
